//
//  AppDelegate.m
//  MacDevTest
//
//  Created by 夏利兵 on 2020/8/5.
//  Copyright © 2020 com.lbx. All rights reserved.
//

#import "AppDelegate.h"
#import "NewWindowController.h"
#import "MainViewController.h"
#import "NormalTableView.h"


@interface AppDelegate ()

//@property (weak) IBOutlet NSWindow *window;
@property (nonatomic, strong) NewWindowController *nextWindow;

@property (nonatomic, strong) MainViewController *mainVC;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
    
    //可以自定义一个控制器替换首页界面，方便代码处理
    _mainVC = [[MainViewController alloc]initWithNibName:@"MainViewController" bundle:nil];
    
    //下面2中方式均可以
//    [self.window setContentView:_mainVC.view];
    self.window.contentViewController = _mainVC;
    
}


- (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
}


- (IBAction)newWindow:(id)sender {
    
    //弹出新窗口, 如果有xib界面，必须通过initWithWindowNibName加载，否则看不见
    NewWindowController *newWindow = [[NewWindowController alloc]initWithWindowNibName:@"NewWindowController"];
    
    
    //下面2行代码，均可以将新页面显示出来
    [newWindow.window orderFront:nil];
//    [newWindow showWindow:nil];
    
     //自己隐藏代码，不调用下面代码，老窗口和新窗口同时显示
    [self.window orderOut:nil];
    
//    self.nextWindow  = newWindow;
}

- (IBAction)normalTableView:(id)sender
{
}


@end
